package com.xmy.cultivate.service;

import com.xmy.cultivate.entity.Student;
import com.xmy.cultivate.entity.StudentFaceData;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xmy.cultivate.entity.views.FaceResult;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xmy.cultivate.entity.views.ClashFace;
import com.xmy.cultivate.entity.views.ResStudentFace;
import com.xmy.cultivate.util.Result;
import org.springframework.scheduling.annotation.Async;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author min
 * @since 2023-01-04
 */
public interface IStudentFaceDataService extends IService<StudentFaceData> {

    public abstract boolean isGather(Long schoolId,Long studentId);

    void updateStudentFaceData(Long schoolId, Long studentId, Long toStudentId, Integer faceType) throws Exception;

    boolean setData(Long schoolId, String studentId, String ossImageUrl, StudentFaceData studentFaceDataOld, Integer faceType) throws Exception;

    boolean updateStudentFace(StudentFaceData studentFaceData, Integer faceType) throws Exception;

    List<StudentFaceData> getDataForStudentIdNeEntityId();

    void updateFaceDataForTransfer(Long outSchoolId, Long inSchoolId, Long studentId);

    IPage<ResStudentFace> getstudentFaceList(IPage<ResStudentFace> page,
                                             String yearPart,
                                             String quarterNum,
                                             String schoolIdStr,
                                             String isSigin,
                                             String studentName);

    IPage<ClashFace> getClashStudentList(IPage<?> page, String yearPart, String quarterNum, String schoolIdStr, String studentName, String isEqName);

    FaceResult batchAddFaceData(String faceDbname, Long schoolId, String ossImageUrl, Student student, Integer faceType) throws Exception;

    IPage<ResStudentFace> getstudentFaceList(IPage<ResStudentFace> page, Wrapper wrapper);

    Result delFaceDataForId(Long id, Integer faceType) throws Exception;

    void delFaceDataForStudentId(Long studentId, Integer faceType) throws Exception;

    Result updateFaceDataForStudentId(Long studentId, Integer faceType) throws Exception;

    List<StudentFaceData> getAtReadingStudent(String studentId, String updateLevel);

    void addFaceDataManyDetailInit(String studentId,Integer pageSize, String updateLevel) throws InterruptedException;

    @Async("onlineAsync")
    void faceDataManyForStudentId(Long studentId, Integer faceType) throws Exception;
}
